package cn.kgc.ffzw.myeat.services.impl;

import cn.kgc.ffzw.myeat.commons.Collection;
import cn.kgc.ffzw.myeat.module.Goods;
import cn.kgc.ffzw.myeat.services.CustomService;

/**
 * @author
 * @Des
 * @date 2019/11/25
 */
public class CustomsImpl extends AbstractUser implements CustomService {

    public Collection goods;
    public CustomsImpl(Collection gds){
        this.goods=gds;
    }

    public CustomsImpl(int userId, String realName, String account, String password, int age, int sex, String telephone, String address, String power) {
        super(userId, realName, account, password, age, sex, telephone, address, power);
    }

    @Override
    public Collection searchGoodsList() {
        return goods;
    }

    @Override
    public Goods findGoodsDetail(int goodId) {
        Goods gd=null;
        for (int i = 0; i < goods.size(); i++) {
            gd=(Goods)goods.get(i);
            if(gd.getGoodId()==goodId){
                break;
            }
        }
        return gd;
    }

    @Override
    public boolean addOrder(int ordId, int goodId, int buynum) {

        //如果数组中已有

        return false;
    }


}
